#include "ScriptedPch.h"
#include "Teleporter.h"

bool GoHello_teleporter(Player *pPlayer, GameObject *pGO)
{
	pPlayer->ADD_GOSSIP_ITEM(0, "Playertreffs", GOSSIP_SENDER_MAIN, treffs);
	pPlayer->ADD_GOSSIP_ITEM(0, "Instanzen", GOSSIP_SENDER_MAIN, instance);

	//pPlayer->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, pGO->GetGUID());
	pPlayer->SEND_GOSSIP_MENU(40005, pGO->GetGUID());
    return true;
}

bool GOSelect_teleporter( Player *pPlayer, GameObject *pGO, uint32 sender, uint32 action )
{
    switch(action)
    {
		case treffs:
			pPlayer->ADD_GOSSIP_ITEM(2, "Player-Treff-GMInsel      (Lehrer)", GOSSIP_SENDER_MAIN, gminsel);
			pPlayer->ADD_GOSSIP_ITEM(2, "Player-Treff-GMBox        (EQ)", GOSSIP_SENDER_MAIN, gmbox);
			pPlayer->ADD_GOSSIP_ITEM(2, "PVP-Platform                  (GMBox)", GOSSIP_SENDER_MAIN, pvp);
			pPlayer->ADD_GOSSIP_ITEM(2, "Dunkelmond-Jahrmarkt  (Items)", GOSSIP_SENDER_MAIN, dunkelmond);
			pPlayer->ADD_GOSSIP_ITEM(0, "<---", GOSSIP_SENDER_MAIN, main);
			pPlayer->SEND_GOSSIP_MENU(40005, pGO->GetGUID());
		break;

		case instance:
			pPlayer->ADD_GOSSIP_ITEM(2, "Old Ironforge", GOSSIP_SENDER_MAIN, oldif);
			pPlayer->ADD_GOSSIP_ITEM(2, "Ice Crown Citadel", GOSSIP_SENDER_MAIN, icc);
			pPlayer->ADD_GOSSIP_ITEM(0, "<---", GOSSIP_SENDER_MAIN, main);
			pPlayer->SEND_GOSSIP_MENU(40005, pGO->GetGUID());
		break;

		case gminsel:
			pPlayer->TeleportTo(1, 16219.591797, 16230.541016, 8.133559, 1337007);
			pPlayer->CLOSE_GOSSIP_MENU(); break;

		case gmbox:
			pPlayer->TeleportTo(1, 16238.060547, 16403.183594, -63.797356, 3.105889);
			pPlayer->CLOSE_GOSSIP_MENU(); break;

		case pvp:
			pPlayer->TeleportTo(1, 16227.579102, 16401.503906, -17.090155, 1.519386);
			pPlayer->CLOSE_GOSSIP_MENU(); break;

		case dunkelmond:
			pPlayer->TeleportTo(0, -9152.797852, 348.865234, 165.951126, 4.142587);
			pPlayer->CLOSE_GOSSIP_MENU(); break;

		case oldif:
			pPlayer->TeleportTo(0, -4844.49, -1066.67, 504.917, 4.62657);
			pPlayer->CLOSE_GOSSIP_MENU(); break;

		case icc:
			pPlayer->TeleportTo(571, 5808.829102, 2080.052979, 637.135132, 3.586004);
			pPlayer->CLOSE_GOSSIP_MENU(); break;
		case main:
			pPlayer->ADD_GOSSIP_ITEM(0, "Playertreffs", GOSSIP_SENDER_MAIN, treffs);
			pPlayer->ADD_GOSSIP_ITEM(0, "Instanzen", GOSSIP_SENDER_MAIN, instance);
			pPlayer->SEND_GOSSIP_MENU(40005, pGO->GetGUID());
			return true;
    }

    return true;
}

void AddSC_teleporter()
{
    Script *newscript;
    newscript = new Script;
    newscript->Name = "teleporter";
    newscript->pGOHello = &GoHello_teleporter;
    newscript->pGOSelect = &GOSelect_teleporter;
    newscript->RegisterSelf();
}